<extend name="Common@Layout:hui-admin" />
<block name="title"><title>Administator管理后台</title></block>
<block name="style">

</block>

<block name="main">
<div class="pd-20">
	<form action="{:u('changeclass_post')}" method="post" class="form form-horizontal validator_form close-dialog" id="form-article-add">
		 
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>转前信息：</label>
			<div class="formControls col-8">
				<span>{$lsinfo.term.title}</span><br/>
			  	<span>{$lsinfo.xiaoqu.title}</span><br/>
			  	<span>{$lsinfo.kecheng.title}</span><br/>
			  	<span>{$lsinfo.banji.lessonname}</span>
			</div>
			<div class="col-2"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>转后学期：</label>
			<div class="formControls col-6">
				<span class="select-box mb-5">
				  <select class="select" size="1" name="tid" id="xueqi">
				  	<foreach name="xueqi" item="vo">
				    <option value="{$vo.id}" <if condition="$vo['id'] eq $lsinfo['tid']">selected</if>>{$vo.title}</option>
				    </foreach>
				  </select>
				</span>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>转后班级：</label>
			<div class="formControls col-6">
			  	<span class="select-box mb-5">
				  <select class="select" size="1" name="did" id="xiaoqu">
				  	<foreach name="xiaoqu" item="vo">
				    <option value="{$vo.id}" <if condition="$vo['id'] eq $lsinfo['did']">selected</if>>{$vo.title}</option>
				    </foreach>
				  </select>
				</span>
				<span class="select-box mb-5">
				  <select class="select" size="1" name="cid" id="banji" data-id = "{$lsinfo['cid']}">
				  	
				  </select>
				</span>
				<span class="select-box">
				  <select class="select" size="1" name="lid" id="lesson"  data-id = "{$lsinfo['lid']}">

				  </select>
				</span>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">备注：</label>
			<div class="formControls col-9">
				<textarea name="remark" cols="" rows="" class="textarea"  placeholder="说点什么...最少输入10个字符" datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！" onKeyUp="textarealength(this,200)">{$info.remark}</textarea>
				<p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p>
			</div>
		</div>
	  	<div class="row cl">
	    	<div class="col-9 col-offset-2">
	    		<input type="hidden" name="lsid" value="{$lsinfo.id}">
	      		<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
	    	</div>
	  	</div>
	</form>
</div>
</block>

<block name="script">
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$('.mini-time').datepicker();
	
	$("#xiaoqu").trigger('change');
});

$("#xiaoqu").change(function(){
	var did = $(this).val();
	$.get('/api/ygcl/getclass_new?did='+did,function(data){
		var html = ''
		if(data.status){
			var data_banji = data.data;
			for(var i=0;i<data_banji.length;i++){
				data_banji[i].id == $("#banji").attr("data-id")? str="selected":str="";
				html += '<option value="'+data_banji[i].id+'" '+str+'>'+data_banji[i].title+'</option>'
			}
			$("#banji").empty().append(html);
			$("#banji").trigger('change');
		}
	})
})
$("#banji").change(function(){
	var cid = $(this).val();
	$.get('/api/ygcl/getlesson_new?cid='+cid,function(data){
		var html = ''
		if(data.status){
			var data_lesson = data.data;
			console.log(data_lesson);
			for(var i=0;i<data_lesson.length;i++){
				data_lesson[i].id == $("#lesson").attr("data-id")? str="selected":str="";
				html += '<option value="'+data_lesson[i].id+'" '+str+'>'+data_lesson[i].lessonname+'('+data_lesson[i].lessontime+')</option>'
			}
			$("#lesson").empty().append(html);
		}
	})
})
</script>
</block>